#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/types.h>

int main(int argc,char** argv)
{
  pid_t pid;
  pid = fork();
  if(pid == 0)
  {
    sleep(5);
    printf("I am a child.My pid is %d\n",getpid());
    return 11;
  }

  if(pid > 0)
  {
    int status;
    wait(&status);
    if(WIFEXITED(status))
    {
      printf("child return num is %d \n",WEXITSTATUS(status));
    }
  }

  return 0;
}
